The conventional 3D GPU with mapping functions is able to display 3D images on the screen of a computer system.
FIG. 1 is a schematic block diagram of a conventional GPU. In FIG. 1, the GPU 100 comprises a memory module 11, a fixed filtering module 13 and a programmable shading module 15. The memory module 11 stores a plurality of texture images 111, which are 2D texture images, as represented by coordinates (U,V) in a 2D texture space, with a texel as a smallest addressable unit. The fixed filtering module 13 comprises texture filter 131 and a cache memory 133. The programmable shading module 15 comprises a plurality of shaders such as vertex shader, geometry shader and pixel shader.
When the GPU 100 operates for 3D graphic process, the programmable shading module 15 depicts a 3D object 151 in a 3D screen space (as shown in FIG. 2A or FIG. 2B) and delivers coordinates P(U, V, D) representing the 3D object 151 to the fixed filtering module 13 in the meantime. The fixed filtering module 13 extracts at least one texture image 111 from the memory module 11 and stores the texture image 111 in the cache memory 133. Afterwards, the texture filter 131 in the fixed filtering module 13 maps the coordinates P delivered from the programmable shading module 15 onto the texture images 111 in the texture space. Then, at least one texel point adjacent to each of the coordinates P is acquired from the cache memory 133 so that the texture filter 131 is able to perform a weighted operation on these adjacent texel points to acquire pixel values of the coordinates P. Later, the fixed filtering module 13 transmits the pixel values of the coordinates P to the programmable shading module 15 to map the pixel values of the coordinates P onto the surface of the 3D object 151 so that the object 151 can be texturized.
Moreover, the cache memory 133 stores texture image levels with respective resolutions corresponding to each texture image 111. The size of each texture image level is half the size of a previous level. For example, if the image size of Level 0 is 256×256, the image size of Level 1 would be 128×128, and the image size can be similarly reduced to 1×1. Bi-linear texture filtering is adopted in the fixed filtering module 13 to calculate the pixel values of the coordinates P representing the 3D object 151 by use of a texture image level with an appropriate resolution (for example, the highest resolution). Alternatively, tri-linear texture filtering can be adopted to calculate the pixel values of the coordinates P representing the 3D object 151 by use of two texture image levels with different resolutions.
Please refer to FIG. 2A, which shows conventional bi-linear texture filtering. In FIG. 2A, bi-linear texture filtering is applied on a single texture image level on which texel points (a, b, c, d) around a coordinate P are sampled by a window 1111 having 2×2 texels to calculate pixel values of the coordinate P. Moreover, bi-linear texture filtering can be implemented by a finite impulse response (FIR) filter equation as expressed in Equation (1):
                              P          ⁡                      (                          U              ,              V              ,              D                        )                          =                                            ∑                              k                ∈                                  W                  ⁡                                      (                                          U                      ,                      V                                        )                                                                                                                    ⁢                          {                                                I                  ⁡                                      (                    k                    )                                                  ×                                  C                  ⁡                                      (                    k                    )                                                              }                                +          Coffset                                    (        1        )            where I(k) represents the texel points (k=a, b, c, d), C(k) represents the weight values of the texels (k=a, b, c, d), and Coffset is the offset for calculation by the filter equation.
Furthermore, please refer to FIG. 2B, which shows conventional tri-linear texture filtering. In FIG. 2B, tri-linear texture filtering is applied on two texture image levels 111 (for example, Level 0 and Level 1) with different resolutions based on the size of the 3D object 151. The coordinate P corresponds to the two texture image levels 111 on which texel points (a, b, c, d and e, f, g, h) around a coordinate P are sampled by a window 1111 having 2×2 texels to calculate pixel values of the coordinate P. Moreover, tri-linear texture filtering can be implemented by a finite impulse response (FIR) filter equation as expressed in Equation (1), where I(k) represents the texel points (k=a, b, c, d, e, f, g, h), and C(k) represents the weight values of the texels (k=a, b, c, d, e, f, g, h).
Even though the modern GPU 100 has achieved improved 3D graphics based operations, there are still some problems to be overcome.
For example, since the GPU 100 is used for 3D graphics, the filter equation adopted by the texture filter 131 in the fixed filtering module 13 is designed to achieve 3D graphics functions. Accordingly, the option for the filter equation is limited by 3D graphics based operations. However, if the GPU 100 is to be used in other applications such as image identification and machine learning algorithm, the fixed filtering module 13 is unable to perform an operational process without the assistance of the programmable shading module 15. As a result, the operational loading of the programmable shading module 15 would be heavier. Moreover, some of the functions of the fixed filtering module 13 are disabled, which leads to poor efficiency of hardware.
Accordingly, if the GPU 100 is to be used in other type of image processing, bi-linear/tri-linear texture filtering adopted in the fixed filtering module 13 would fail to access multiple texels in one process, which results in only one texel accessed by the fixed filtering module 13 during each operation clock. As a result, the efficiency of the GPU 100 would be lowered and the bandwidth of hardware would be underused.
Furthermore, the user can only adopt the filter equation (for example, the FIR linear filter equation) pre-determined by the fixed filtering module 13 and fails to flexibly adjust the sample count (for example, fixed as four sampled points), the size of sampling window (for example, fixed as a window with 2×2 texels), the weight value C(k) of the sampled points or the offset Coffset while calculating the pixel values of the coordinates P corresponding to the 3D object 151 by the use of the pre-determined filter equation.